package leetcode_800;

/**
 *@author 周杨
 *DesignHashSet_705 设计hashset
 *describe:用int数组实现 AC 61%
 *2018年10月11日 上午9:36:44
 */
public class DesignHashSet_705 {
	boolean hash[];
	 /** Initialize your data structure here. */
    public DesignHashSet_705() {
        this.hash=new boolean[1000000+1];
    }
    
    public void add(int key) {
        this.hash[key]=true;
    }
    
    public void remove(int key) {
        this.hash[key]=false;
    }
    
    /** Returns true if this set contains the specified element */
    public boolean contains(int key) {
        return this.hash[key];
    }

}
